// 这里是获取文章信息的接口，所以创建了article.js
import request from '@/utils/request'  //这里导入了已经封装了请求和响应的拦截器request

//获取文章分类
//文档中没有传递参数
export const artGetChannelsService=()=>request.get('/my/cate/list')

//新增分类接口
export const artSetChannelsService=(data)=>{
	return request.post('/my/cate/add',data)
}
//接口里面是body参数
export const artEditChannelsService=(data)=>{
	return request.put('/my/cate/info',data)
}

//接口里面是query参数
export const artDeleteChannelsService=(id)=>{
	return request.delete('/my/cate/del',{
		params:{
			id
		}
	})
}

//获取文章列表接口
//请求参数格式
export const artGetManageService=(params)=>{
	return request.get('/my/article/list',
		{params}
	)
}

//添加文章
export const artPublishService=(data)=>request.post('/my/article/add',data)

//获取文章详情
export const artGetDetailsService=(id)=>{
	return request.get('/my/article/info',{
		params:{
			id
		}
	})
}
//编辑文章接口
export const artEditService=(data)=>request.put('/my/article/info',data)

//删除
export const artDelService = (id) => request.delete('my/article/info', { params: { id } })